#ifndef _H_FIR_
#define _H_FIR_
#include "define.h"

#define FIR_SAMPLESIZE_PERPERIOD 128
typedef struct{
	float freq;
	float amp;
	float angle;
}STRZPNodeType;
typedef union{
	float f[512][2];
	float vars[1024];
}UNDataBuffType;
extern UNDataBuffType fir_cal_databuff;
extern U16 x_pointer;
extern void fir_get_zp(float freq, STRZPNodeType *zps, U16 zpssize, STRZPNodeType *calz, U16 *RN);

extern void fir_get_coef(STRZPNodeType *zps, U16 N, float df, U8 linera, float *coef);

extern void fir_filter_data(float *x, U16 n, float *firecoef, U16 firn, float *y);

extern void fir_get_zp_ex(float freq,U16 attr[][2], U16 attrsize, float startfreq, float freqgap, STRZPNodeType *calz, U16 *RN);
extern void fir_get_adcdata(U16 *rsample, float rsamplerate, U16 rsamplesize, float freq, float *esample, float esamplerate, U16 esamplesize);
extern void fir_reset_pointer(void);
#endif